<?php 
namespace app\site\validate;
use think\Validate;

class SiteSetting extends Validate
{
 	/**
 	 * 规则
 	 * @var [type]
 	 */
 	protected $rule = [
 		'site_id' => 'require',
 		'custom_id' => 'require',
 		'type' => 'require',
 		'appid' => 'require|length:8',
 		'appkey' => 'require|length:32',
 		'appsecret' => 'require|length:32',
 	];

 	/**
 	 * 提示信息
 	 * @var [type]
 	 */
 	protected $message = [
 		'site_id' => '缺少站点名称',
 		'custom_id' => '缺少客户信息',
 		'type' => '缺少配置类型',
 		'appid.require' => '缺少AppID',
 		'appid.length' => 'AppID必须为8位长度',
 		'app_key.require' => '缺少App Key',
 		'app_key.length' => 'App Key必须为32位长度',
 		'app_secret.require' => '缺少App Secret',
 		'app_secret.length' => 'App Secret必须为32位长度',
 	];
	/**
 	 * 场景
 	 * @var [type]
 	 */
 	protected $scene =[
 		'setting' => ['site_id','custom_id','type','appid','app_key','app_secret'],
 		'create' => ['custom_id','appid','app_key','app_secret']
 	];

 }